const baseUrl = "http://127.0.0.1:8000/api";
export const request = (options) => {
  return fetch(baseUrl+options.url,{
    method: options.method,
    headers: options.headers || {
      "Content-Type": "application/json",
    },
    body:options.data?JSON.stringify(options.data):null,
    params: options.params || null,
  })
  .then((res) => res.json())
  .catch((err) => {
    console.error(err);
  });
};
